from typing import Optional
from datetime import datetime
from pydantic import BaseModel

class ElevyStampBase(BaseModel):
    package_order_id: int
    package_order_title: Optional[str] = None
    ReferenceNo: str
    customer_name: str
    customer_phone: str
    package_order_total_amount: float
    dep_date: datetime
    ElevyStampNo: str
    WorkAreaShortName: str
    WorkAreaLicNo: str
    ElevyStampAmount: float
    ElevyStampCreateTime: datetime
    ElevyStampUrl: str
    ElevyStampStatus: str
    RefundTime: Optional[datetime] = None

class ElevyStampCreate(ElevyStampBase):
    pass

class ElevyStampUpdate(BaseModel):
    package_order_title: Optional[str] = None
    ReferenceNo: Optional[str] = None
    customer_name: Optional[str] = None
    customer_phone: Optional[str] = None
    package_order_total_amount: Optional[float] = None
    dep_date: Optional[datetime] = None
    ElevyStampNo: Optional[str] = None
    WorkAreaShortName: Optional[str] = None
    WorkAreaLicNo: Optional[str] = None
    ElevyStampAmount: Optional[float] = None
    ElevyStampUrl: Optional[str] = None
    ElevyStampStatus: Optional[str] = None
    RefundTime: Optional[datetime] = None

class ElevyStamp(ElevyStampBase):
    ID: int
    work_area_id: int

    class Config:
        from_attributes = True 